import lombok.AllArgsConstructor;
import lombok.Data;

import java.util.HashMap;
import java.util.concurrent.ConcurrentHashMap;

@AllArgsConstructor
@Data
public class Test {

    private int  age;
    private String  name;


    public static void main(String[] args) {
        Solution solution = new Solution();
        int[] nums={1,1,2};
        int i = solution.removeDuplicates(nums);
        System.out.println(i);
        HashMap<Object, Object> objectObjectHashMap = new HashMap<>(10);
        HashMap<Object, Object> objectObjectHashMap2 = new HashMap<>();
        objectObjectHashMap2.put("a",1);

        TestTemp a = TestTemp.builder().test(1).test2(2.0).test3("a").build();
//        a.toBuilder().test2(3.0);
        System.out.println(1);

//        return (new TestTemp.TestTempBuilder()).test(this.test).test2(this.test2).test3(this.test3);

    }


    static class Solution {
        public int removeDuplicates(int[] nums) {
            if (nums.length==0){
                return 0;
            }
            int slow = 0;
            for(int fast=0;fast<nums.length-1;fast++){
                if(nums[fast]!=nums[fast+1]) {
                    nums[slow]=nums[fast];
                    slow++;
                }
            }
            return  slow+1;
        }
    }


}
